package com.wncinema.interfaces;

import java.util.List;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;

import com.wncinema.bean.HallBean;
import com.wncinema.bean.ScheduleBean;
import com.wncinema.bean.SeatBean;

@FeignClient(name = "wncinema-zuul")
public interface ScheduleHandler {

	//查询指定日期的所有排片信息
	@GetMapping("/schedule/{date}")
	public List<ScheduleBean> findByDate(@PathVariable("date")String date);
	//查询指定日期的某部电影的排片信息
	@GetMapping("/schedule/{mid}/{date}")
	public List<ScheduleBean> findByDateAndMid(@PathVariable("mid")int mid,@PathVariable("date")String date);
	//添加排片信息
	@PostMapping("/schedule")
	public int add(ScheduleBean bean);
	//删除排片信息
	@DeleteMapping("/schedule/{id}")
	public int delete(@PathVariable("id")int id);
	//显示每个座位的售票情况
	@GetMapping("/seats/{id}")
	public List<SeatBean> showSeats(@PathVariable("id")int id);
	//买票	bean的参数（seats座位，sid）
	@PostMapping("/tickets")
	public int buyTickets(ScheduleBean bean);
	//退票	bean的参数（seats座位，sid）
	@PostMapping("/tickets/version")
	public int  gobackTickets (ScheduleBean bean);
	//显示厅的全部座位
	@GetMapping("/hall/{id}")
	public List<SeatBean> showHallSeats(@PathVariable("id")int id);
	//添加座位		bean的参数（seats座位，hid）
	@PutMapping("/hall/seat1")
	public int addSeats(HallBean bean);
	//删除座位         bean的参数（seats座位，hid）
	@PutMapping("/hall/seat2")
	public int deleteSeats(HallBean bean);
	
}
